/*
 * Button.c
 *
 * Created: 11/13/2012 3:04:42 PM
 *  Author: Hp-Minion
 */ 
/*****************************************************************************************/
#include <avr/io.h>
#include <avr/interrupt.h>
#include "General.h"
#include "Port.h"
#include "Button.h"
#include "Timer.h"
/*****************************************************************************************/
volatile unsigned int nCounts = 1;
volatile unsigned int reading = 0;
volatile unsigned int Wvar = 0;
volatile unsigned int Rvar = 0;
/*****************************************************************************************/
void Button_Init(unsigned char pin)
{
	PinMode(pin,'D',INPUT);		/*	Digital Button 	*/
}
/*****************************************************************************************/

/*****************************************************************************************/
//void Button_Handler(void)
//{	
	//reading = nCounts % 2;
	//if (reading == 1)
	//{
		////Timer0_vStopTimer2();
		//if ((nCounts/2) < 10)
		//{
			//Wvar = nCounts/2;
			//EEPROM_write(LOCATION,Wvar);
			//Rvar = EEPROM_read(LOCATION);
			////Display7_vDisplayNumber(Rvar);
		//} 
		//else if((nCounts/2) == 10)
		//{
			//nCounts = 1;
			//Wvar = nCounts/2;
			//EEPROM_write(LOCATION,Wvar);
			//Rvar = EEPROM_read(LOCATION);
			////Display7_vDisplayNumber(Rvar);
		//}
		//
	//}
	//else
	//{
		////Timer0_vStartTimer2();
	//}
	//
//}
/*****************************************************************************************/
//ISR(INT0_vect)
//{
	//nCounts++;
	//Button_vHandler();
//}
/*****************************************************************************************/